package com.computercourse.learning.dao;

import com.computercourse.framework.domain.learning.CicLearningCourse;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @description:
 * @author: yuanfeng
 * @date: Created in 2020/2/15 4:05 下午
 * @version: 1.0
 */
@Repository
public interface CicLearningCourseRepository extends PagingAndSortingRepository<CicLearningCourse,String> {

    //根据用户Id和课程Id查询
    CicLearningCourse findByUserIdAndCourseId(String userId,String courseId);

    Page<CicLearningCourse> queryAllByUserId(@Param("userId") String userId,Pageable pageable);
}
